﻿using System;

namespace StrategyPattern
{
    internal class Program
    {
        /// <summary>
        /// 策略模式
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ICalculate calculate = new Add();
            double result = calculate.Sum(1, 2);
            Console.WriteLine($"Add:{result}");

            ICalculate calculate1 = new Division();
            double result1 = calculate1.Sum(1, 2);
            Console.WriteLine($"Division:{result1}");

            ICalculate calculate2 = new Multiplication();
            double result2 = calculate2.Sum(1, 2);
            Console.WriteLine($"Multiplication:{result2}");

            ICalculate calculate3 = new Subtraction();
            double result3 = calculate3.Sum(1, 2);
            Console.WriteLine($"Subtraction:{result3}");
        }
    }
}
